<template>
    <div>
        <h2>登录</h2>
        <table class="table table-bordered">
            <tbody>
                <tr>
                    <td align="right" >账号</td>
                    <td>
                        <input type="text" v-model="data.name"/>
                    </td>
                </tr>

                <tr>
                    <td align="right">密码</td>
                    <td>
                        <input type="password" v-model="data.pwd"/>
                    </td>
                </tr>

                <tr>
                    <td align="right"></td>
                    <td>
                        <input type="button" value="登录" class="ntn btn-primary" @click="Login">
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</template>

<script setup lang="ts">
import {ref,reactive} from 'vue'

let data=ref({
    name:"",
    pwd:""
})

const Login=()=>{
    //判断有效行
    if(data.value.name==""){
        alert('账号不能为空');
        return;
    }
    if(data.value.pwd==""){
        alert('密码不能为空');
        return;
    }

}
</script>

<style scoped>

</style>